/**
 * 
 */
package com.net.dao;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.ibatis.sqlmap.client.SqlMapClient;
import com.net.domain.User;
import com.net.web.form.LoginForm;

/**
 * @author Dinesh
 *
 */
public class UserDao {
	
	final static Logger log = Logger.getLogger(UserDao.class);
	
	private SqlMapClient sqlMapClient;
	
	public User isLoginSuccess (LoginForm loginForm) {
		
		User user = null;
		
		try {
			
			user = (User)sqlMapClient.queryForObject("loginCheck", loginForm);
			
		}
		catch (Exception e) {
			log.error("The login attempt threw an exception " + e.getMessage());
		}
		
		log.info("The user  object " + user);
		
		
		return user;		
	}

	/**
	 * @return the sqlMapClient
	 */
	public SqlMapClient getSqlMapClient() {
		return sqlMapClient;
	}

	/**
	 * @param sqlMapClient the sqlMapClient to set
	 */
	@Autowired
	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}
	

}
